/* === Theme === */
:root {
    --page-bg: #e7ebf1;
    --sheet-bg: #ffffff;
    --text-strong: #111827;
    --text-body: #475569;
    --text-muted: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.12);
    --link: #1e3a8a;
    --link-hover: #1d4ed8;
    --accent-warm: #9a3412;
    --badge-bg: #f3f4f6;
    --shadow-sheet: 0 10px 28px rgba(15, 23, 42, 0.06);
}

/* === Base === */
html,
body {
    margin: 0;
    background: var(--page-bg) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text-body);
}

body {
    line-height: 1.72;
}

a,
button {
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 0.14em;
    text-decoration-thickness: 0.06em;
}

a:hover {
    color: var(--link-hover);
}

.mathjax-message {
    display: none;
}

#main-container {
    padding: 30px 0 44px;
    min-height: 100vh;
    background: var(--page-bg) !important;
}

#layout-content {
    width: min(1080px, calc(100% - 72px)) !important;
    margin: 0 auto !important;
    padding: 30px 38px 40px !important;
    background: var(--sheet-bg) !important;
    color: var(--text-body);
    border: none !important;
    box-shadow: var(--shadow-sheet) !important;
}

#toptitle {
    margin-bottom: 18px;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 600;
    color: var(--text-strong);
}

#layout-content > h2:not(.page-title) {
    margin: 46px 0 16px;
    font-size: 25px;
    font-weight: 620;
    letter-spacing: -0.018em;
}

#layout-content > h2:not(.page-title)::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-top: 9px;
    background: rgba(30, 58, 138, 0.16);
}

.page-title {
    margin: 0 0 20px;
    font-size: 41px;
    font-weight: 680;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--text-strong);
}

/* === Profile === */
.profile-section {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin: 8px 0 24px;
    padding: 6px 0 18px;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    flex: none;
}

.profile-avatar img {
    display: block;
    width: 100%;
    aspect-ratio: 0.92 / 1;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.profile-info {
    padding-top: 2px;
}

.profile-meta {
    margin-bottom: 20px;
}

.profile-meta-line {
    font-size: 16px;
    line-height: 1.6;
    color: #243041;
}

.profile-meta-line + .profile-meta-line {
    margin-top: 3px;
}

.profile-meta-line a {
    color: inherit;
}

.profile-label {
    font-weight: 700;
    color: var(--text-strong);
}

.profile-links-line {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.profile-links-line a,
.profile-links-line .pending-link {
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.profile-links-line a:hover {
    color: var(--link);
}

.profile-links-line .pending-link {
    color: var(--text-muted);
    cursor: default;
}

.link-sep {
    margin: 0 8px;
    color: #c7ced8;
}

.profile-bio {
    margin-top: 2px;
    font-size: 15.6px;
    line-height: 1.82;
    color: var(--text-body);
}

.profile-bio b {
    font-weight: 650;
    color: var(--text-strong);
}

/* === News === */
.news-container,
.exp-section,
.info-section {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.news-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.news-date {
    flex: 0 0 82px;
    color: #6b7280;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.045em;
}

.news-content {
    flex: 1;
    font-size: 14.2px;
    line-height: 1.7;
    color: var(--text-body);
}

.h-red {
    color: var(--accent-warm);
    font-weight: 600;
}

.h-blue {
    color: var(--link);
    font-weight: 600;
}

.news-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    color: var(--text-muted);
    background: var(--badge-bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 9.4px;
    font-weight: 700;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

#news-hidden {
    display: none;
}

.news-more-btn {
    display: inline-block;
    width: auto;
    margin-top: 10px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.news-more-btn:hover {
    color: var(--link);
}

/* === Experience === */
.exp-item {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.exp-time {
    flex: 0 0 140px;
    padding-top: 2px;
    padding-right: 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.6;
    text-align: right;
}

.exp-content {
    position: relative;
    flex: 1;
    padding-left: 22px;
    padding-bottom: 18px;
    border-left: 1px solid var(--line-strong);
}

.exp-item:last-child .exp-content {
    padding-bottom: 0;
}

.exp-content::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 6px;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 50%;
}

.exp-org {
    margin-bottom: 4px;
    font-size: 17px;
    font-weight: 620;
    line-height: 1.3;
    color: var(--text-strong);
}

.exp-org a {
    color: inherit;
}

.exp-role {
    margin-bottom: 6px;
    font-size: 14.8px;
    font-weight: 600;
    color: #374151;
}

.exp-desc {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-body);
}

.exp-desc a {
    color: var(--link);
}

.year-header {
    margin: 16px 0 10px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* === Responsive === */
@media (max-width: 860px) {
    #main-container {
        padding: 0;
    }

    #layout-content {
        width: 100% !important;
        padding: 20px 22px 28px !important;
        box-shadow: none !important;
    }

    .page-title {
        font-size: 33px;
    }

    #layout-content > h2:not(.page-title) {
        margin-top: 36px;
        font-size: 22px;
    }

    .profile-section {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 18px;
    }

    .profile-avatar {
        max-width: 220px;
    }

    .profile-bio {
        font-size: 15px;
    }

    .news-row,
    .exp-item {
        flex-direction: column;
        gap: 6px;
    }

    .news-date,
    .exp-time {
        flex: none;
        width: auto;
        padding-right: 0;
        text-align: left;
    }

    .exp-content {
        padding-left: 0;
        padding-top: 12px;
        border-left: none;
        border-top: 1px solid var(--line-strong);
    }

    .exp-content::before {
        left: 0;
        top: -5px;
    }
}
